﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;

namespace BusinessLibrary.BLL
{
 public  class Matiere
    {
        # region var
        public int  Id { get; set; }
        public string Nom { get; set; }
        public float Coefficient { get; set; }
        public Module module { get; set; } 

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Matiere GetMatiereById(int id)
        {
            return sqlMatiere.GetMatiereById(id);
        }


        public static int deleteMatiere(int id, string nom, float Coefficient, int id_module)
        {
            return sqlMatiere.deletMatiere(id, nom, Coefficient, id_module);
        }


        public static int SaveModule(Matiere m)
        {
            int nbRow;
            if ((nbRow = sqlMatiere.updateMatiere(m)) > 0)
                return nbRow;
            else
                return sqlMatiere.insertMatiere(m);
        }
    }
        #endregion
    }

